#ifndef BUFFER_H_
#define BUFFER_H_

#include "stm32f4xx_hal.h"
#include "stdint.h"
#include "stddef.h"
#include "stdbool.h"

typedef struct _Buffer buffer_t;

struct _Buffer
{
    uint8_t *HeadPtr;
    uint32_t Capacity;
    uint32_t Position;
    uint32_t Limit;
    uint32_t Mode;
};

/**
 * @api
 * @{
 */
void Buffer_Init(buffer_t *thiz, uint8_t *headPtr, uint32_t capacity);
void Buffer_Put(buffer_t *thiz, uint8_t data);
void Buffer_Fill(buffer_t *thiz, uint8_t *dataPtr, uint32_t len);
void Buffer_Reset(buffer_t *thiz);
void Buffer_Flip(buffer_t *thiz);
bool Buffer_IsEmpty(buffer_t *thiz);
bool Buffer_IsFull(buffer_t *thiz);
bool Buffer_HasNext(buffer_t *thiz);
uint8_t Buffer_Next(buffer_t *thiz);
/**
 * @}
 */
#endif /* BUFFER_H_ */
